package com.biostime.qdingding.modules.qd.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.biostime.qdingding.common.service.CrudService;
import com.biostime.qdingding.modules.qd.dao.CoursepriceDao;
import com.biostime.qdingding.modules.qd.entity.Courseprice;

/**
 * 课程价格Service
 * @author king
 * @version 2015-11-18
 */
@Service
@Transactional(readOnly = true)
public class CoursepriceService extends CrudService<CoursepriceDao, Courseprice> {
	
	@Override
	public List<Courseprice> findList(Courseprice entity) {
		dataScopeFilter(entity, "dsf", "id=a.center_id", "id=a.create_by");
		
		return super.findList(entity);
	}
	
	//中心只能存在一个忙时价格
	public List<Courseprice> onlyOne(Courseprice courseprice) {
		dataScopeFilter(courseprice, "dsf", "id=a.center_id", "id=a.create_by");
		return dao.onlyOne(courseprice);
	}
	
	
	
//	<!-- ————————————————————————————楚河汉界，谁敢动我的，打死 ————————————————————————————————————-->	
	
	public List<Courseprice> apiGetPrice(int type,String centerId){
		return dao.apiGetPrice(type, centerId);
		
	}
	
}
